package com.liuliwei.dubboconsumer;

import com.alibaba.dubbo.config.annotation.Reference;
import com.liuliwei.service.HelloService;
import com.liuliwei.service.OkService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.List;

@RestController
public class HelloController {
    @Reference
    private HelloService helloService;
    @Reference
    private OkService okService;


    @RequestMapping("/hello")
    public String hello() {
        String hello = helloService.sayHello("world");
        String[] atp = {"Rafael", "Novak", "Stanislas","David","Roger","Andy Murray","Tomas Berdych", "Juan Martin Del Potro"};
        List<String> players =  Arrays.asList(atp);

        System.out.println(helloService.sayHello("world"));
        System.out.println(okService.sayOk("liuliwei","30"));
        helloService.sayList(players);
        return hello;
    }
}
